<?php

/**
 * Description of character
 *
 * @author Christian Simon
 */
class modelCharacter {
    
    public $id;
    public $surname;
    public $class;
    public $rank;
    public $status;
    public $race;
    public $gender;
    public $profession;
    public $portrait;
    
    public static $table = "character";

    public function deserialize($query) {
        $query = (object) $query;
        $this->id = $query->_id;
        $this->surname = htmlentities($query->surname, ENT_QUOTES, 'UTF-8');
        $this->class = $query->class;
        $this->rank = controllerRank::getNameById($query->_rid,'Guild');
        $this->status = htmlentities($query->status, ENT_QUOTES, 'UTF-8');
        $this->gender = $query->gender;
        $this->profession = htmlentities($query->profession);
        $this->portrait = $query->portrait;
        $this->race = $query->race;
        return $this;
    }
}

?>
